package com.softme.trade.util;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanFactory
{

	private static ClassPathXmlApplicationContext ctx;

	static
	{
		ctx = new ClassPathXmlApplicationContext("spring-config.xml");
	}

	private BeanFactory()
	{
	}

	public static Object getBean(String beanName)
	{
		return ctx.getBean(beanName);
	}

	@SuppressWarnings("unchecked")
	public static Object getBean(String beanName, Class classe)
	{
		return ctx.getBean(beanName, classe);
	}

}
